﻿namespace Sidvall.WorkItemManager.Data.Keys
{
    public class WorkItemSensorLogKey
    {
        public System.DateTime ValueTimestamp { get; set; }
        public long WorkItemSensorId { get; set; }
        
        public static WorkItemSensorLogKey GetKey(IWorkItemSensorLog item)
        {
            if (item == null)
                return null;
            return new WorkItemSensorLogKey()
            {
                ValueTimestamp = item.ValueTimestamp,
                WorkItemSensorId = item.WorkItemSensorId,
            };
        }
        public static WorkItemSensorLogKey GetKey(System.DateTime valueTimestamp, long workItemSensorId)
        {
            return new WorkItemSensorLogKey()
            {
                ValueTimestamp = valueTimestamp,
                WorkItemSensorId = workItemSensorId,
            };
        }
    }
}